// 声明一个变量a 类型为 number 值为 2
let a: number = 2;

// 函数声明 参数类型 返回值类型
function sum(a: number, b: string): string {
  return a + b;
}

sum(333, "ss");

let zml: 10;
zml = 10;

let f;

let strL: string;
let sn: unknown;
sn = "ddd";
// strL = sn
if (typeof sn === "string") {
  strL = sn;
}

enum Gender {
  Male = 0,
  Female = 1,
}
let i: { name: string; gender: Gender };
i = {
  name: "xx",
  gender: Gender.Male,
};


// &
let j: { name: string } & { age: number };
j = { name: "d", age: 12 };


// 类型别名

type myType = string
let m:myType

type type2 = 1|2|3
let m2:type2